﻿<UserControl x:Class="Kokomo.Environment.Hosting.EditorViewWrapper"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
			 xmlns:env="clr-namespace:Kokomo.Environment"
			 xmlns:doc="clr-namespace:Kokomo.Environment.Documents"
			 xmlns:kui="xaml://kokomo/ui"
			 xmlns:cmd="clr-namespace:Kokomo.Environment.Commanding"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
	<UserControl.Resources>

		<ControlTemplate x:Key="SeparatorTemplate">
			<Separator/>
		</ControlTemplate>
		
		<DataTemplate DataType="{x:Type kui:ProgressInfo}">
			<ContentPresenter Content="{Binding}" ContentTemplate="{DynamicResource {x:Static env:EditorStyleKeys.ProgressInfoTemplateKey}}"/>
		</DataTemplate>
		<DataTemplate DataType="{x:Type cmd:CommandViewModel}">
			<ContentPresenter Content="{Binding}" ContentTemplate="{DynamicResource {x:Static env:EditorStyleKeys.CommandViewTemplateKey}}"/>
		</DataTemplate>

		<Style TargetType="{x:Type TabItem}" BasedOn="{StaticResource {x:Static env:EditorStyleKeys.SectionTabStyleKey}}"/>

		<Style TargetType="{x:Type TabControl}" BasedOn="{StaticResource {x:Static env:EditorStyleKeys.SectionTabControlStyleKey}}"/>
		
		<Style TargetType="{x:Type MenuItem}">
			<Setter Property="Header" Value="{Binding Text}"/>
			<Setter Property="Icon" Value="{Binding Icon}"/>
			<!--<Setter Property="Icon">
			<Setter.Value>
				<Image Source="{Binding IconSource}"/>
			</Setter.Value>
		</Setter>-->
			<Setter Property="ItemsSource" Value="{Binding Items}"/>
			<Setter Property="Command" Value="{Binding Command}"/>
			<Setter Property="CommandParameter" Value="{Binding CommandArgument}"/>

			<Style.Triggers>
				<DataTrigger Binding="{Binding}" Value="{x:Null}">
					<Setter Property="Template" Value="{StaticResource SeparatorTemplate}"/>
				</DataTrigger>
				<DataTrigger Binding="{Binding IsVisible}" Value="False">
					<Setter Property="Visibility" Value="Collapsed"/>
				</DataTrigger>
			</Style.Triggers>
		</Style>
		

		<DataTemplate DataType="{x:Type doc:TreeNodeViewModel}">
			<doc:TreeNodeView/>
		</DataTemplate>

		<Style TargetType="{x:Type kui:DocumentItem}">
		</Style>

		<Style TargetType="{x:Type kui:DocumentTab}">
			<Setter Property="Height" Value="50"/>
			<Setter Property="Background" Value="{DynamicResource {x:Static env:EditorStyleKeys.ActiveTabColorKey}}"/>
		</Style>
	</UserControl.Resources>
</UserControl>
